#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,m;
struct edge
{
    int to;
    int w;
    int next;
}edges[N];
int count_edge;
int head[N];
int d[N];//记录每个点的入度
vector<int> ret;
void add(int u,int v,int w)
{
    edges[count_edge].w=w;
    edges[count_edge].to=v;
    edges[count_edge].next=head[u];
    head[u]=count_edge++;
}
bool solve()
{
    queue<int>q;
    for(int i=1;i<=n;i++)
    {
        if(d[i]==0) 
        {
            q.push(i);
        }
    }
    if(q.empty()) return false;

    while(q.size())
    {
        int tem=q.front();
        q.pop();
        ret.push_back(tem);
        for(int i=head[tem];i!=-1;i=edges[i].next)
        {
            int nextnode=edges[i].to;
            if(--d[nextnode]==0) q.push(nextnode);
        }
    }
    return ret.size()==n;

}
int main()
{
    memset(head,-1,sizeof(head));
    memset(d,0,sizeof(d));
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        int u,v;
        cin>>u>>v;
        add(u,v,1);
        d[v]++;
    }
    if(solve())
    {
        for(auto&ch:ret) cout<<ch<<" ";
    }
    else
    {
        cout<<-1;
    }
    return 0;
}


